<template>
	<!-- D:/project/app/ydz-app-uniapp/static/images/login -->
	<view class="pagebody" :style="{ minheight: maxHeight }">
		<view class="topbgbox">
			<view class="align-center justify-center pos-rel">
				<image class="pos-abs" @click="backpage" src="@/static/images/login/leftjt.png" alt=""
					style="width: 48rpx;height: 48rpx;left: 0;"></image>
				<view class=" fz36">
					完善个人资料
				</view>
			</view>
			<view class="fz32 color303b39 flex-row align-center fwbold" style="margin-top: 82rpx;">
				其他选填信息
			</view>
			<view class="fz32 flex-row align-center fwbold" style="margin-top: 64rpx;color: #7E8987;">
				正在服用的药品
			</view>
			<view class="inputbox" style="margin-top: 8rpx;">
				<uni-easyinput v-model="endform.drugName" :placeholderStyle="placeholderStyle"
					placeholder="请您输入正在服用的药品"></uni-easyinput>
			</view>
			<view class="fz32 flex-row align-center fwbold" style="margin-top: 60rpx;color: #7E8987;">
				正在使用的疗法
			</view>
			<view class="inputbox" style="margin-top: 8rpx;">
				<uni-easyinput v-model="endform.therapy" :placeholderStyle="placeholderStyle"
					placeholder="请您输入正在使用的疗法"></uni-easyinput>
			</view>
			<view class="fz32 flex-row align-center fwbold" style="margin-top: 60rpx;color: #7E8987;">
				目前治疗效果
			</view>
			<view class="inputbox" style="margin-top: 8rpx;">
				<uni-easyinput v-model="endform.treatmentEffect" :placeholderStyle="placeholderStyle"
					placeholder="请您输入目前治疗效果"></uni-easyinput>
			</view>



			<view class="align-center loginbtn justify-between">
				<button class="button fwbold" type="primary" @click="submit">提交</button>
			</view>
		</view>
		<u-toast ref="uToast" />


	</view>
</template>

<script>
	import store from "@/store"
	import {
		addDocument
	} from '@/api/api.js'
	
	export default {
		onLoad() {
			// 获得屏幕最大高度
			let systemInfo = uni.getSystemInfoSync();
			this.maxHeight = systemInfo.windowHeight + "px";
		},
		data() {
			return {
				maxHeight: '',
				placeholderStyle: "color:#7E8987;font-size:32rpx",
				drugname: '',
				therapy:'',
				effect:'',
				endform:{},
			}
		},
		created() {

		},
		mounted() {
			let obj = store.state.other.areaform
			this.endform = obj
		},
		methods: {
			submit() {
				addDocument(this.endform).then(res=>{
					this.$refs.uToast.show({
						title: '完善信息完成！',
					})
					setTimeout(()=>{
						uni.navigateTo({
							url:'/pages/home'
						})
					},1000)
				})

			},
			backpage() {
				uni.navigateBack({
					delta: 1
				});
			},

		}
	};
</script>

<style lang="scss" scoped>
	page {
		background: #fff;
	}

	::v-deep .is-input-border {
		border: none;
	}

	::v-deep .uni-easyinput__content {
		background: transparent !important;
	}

	::v-deep .uni-input-input {
		font-size: 32rpx;
	}

	::v-deep uni-checkbox .uni-checkbox-input {
		background: transparent;
	}

	::v-deep uni-checkbox .uni-checkbox-input.uni-checkbox-input-checked {
		color: #fff;
		border-color: #00D9B2;
		background: #00D9B2;
	}

	::v-deep .uni-icons {
		font-size: 52rpx !important;
	}

	::v-deep uni-toast {
		font-size: 24rpx;
	}

	.pagebody {
		box-sizing: border-box;
		background-image: url('/static/images/login/otherbg.png');
		position: relative;
		background-repeat: no-repeat;
		background-size: cover;

		.topbgbox {
			box-sizing: border-box;
			padding: 14rpx 40rpx 0;

			.inputbox {
				border-bottom: 1px solid #B8C3C1;
				padding-bottom: 10rpx;
			}

			.loginbtn {
				// position: absolute;
				// bottom: 0;
				margin-top: 96rpx;

				uni-button {
					border-radius: 98rpx;
					width: 668rpx;
				}

				uni-button:after {
					border: none;
				}

				.button {
					background-color: #00D9B2;
					display: flex;
					align-items: center;
					justify-content: center;
					font-size: 36rpx;

				}
			}
		}

	}
</style>